﻿using PersistenceLayer.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PersistenceLayer.DAL
{
	public class ContatoDAL
	{
		private Entities Entity;

		public ContatoDAL()
		{
			Entity = new Entities();
		}

		public Int64 Adicionar(Contato c)
		{
			Entity.Contato.Add(c);
			Entity.SaveChanges();
			return c.ID;
		}

		public Contato Obter(Int64 id)
		{
			return Entity.Contato.Where(a => a.ID == id).SingleOrDefault();
		}
	}
}
